<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<base href="<?= base_url(1); ?>" />
<link type="text/css" href="css/main.css?v=<?= $config['version'] ?>"
	rel="stylesheet" />
<script src="js/time.js?">
        <script src="js/jquery-1.7.1.min.js">
        </script>
<script>
		//验证输入的数据是否有效 0<strValue<=1
        function lessOne(f,showId)
		{
    		return true;
    		alert(showId);
    		//alert(f);
    		//alert(strValue);
    		var re=/^1\b|^0.\d/;
    		//var re = /1/;
    		//alert(re.test(strValue));
    		if(true != re.test(f.value))
    		{
        		//alert('invalid param,valid 0 < value <=1,please input again');
        		//var s = document.getElementById(showId);
        		//s.value = 'invalid param,valid 0 < value <=1,please input again';
        		$("#" +showId).val('invalid param,valid 0 < value <=1,please input again');
        		//f.value = 1;
        		alert($("#"+showId).val());
        		f.focus();
    		}
		}

		//strValue>=1
		function bigOne(strValue)
		{
			//alert(showId);
    		//alert(strValue);
    		var re=/^[1-9][0-9]*/;
    		//var re = /1/;
    		//alert(re.test(strValue));
    		if(true != re.test(strValue))
    		{
        		//var s='#'+showId;
        		//alert(s);
        		alert('invalid param,valid value >=1, please input again');
        		//$(s).val('invalid param,please input again');
        		//document.showId.focus();
        		this.focus();
    		}
		}
        </script>
</head>
<body>
<?php include(VIEWPATH . 'common/main_header.php'); ?>
<?php
//print_r($row);
//echo " tablename = ".$tablename;
//echo " modulename = ".$modulename;
?>

<form action="" method="POST" id="rowForm">
<table width="100%" border="0" cellspacing="1" cellpadding="0"
	class="tablegrid tableedit">
	<tr>
		<td><?= translate('ACTIVITY_MODULE_DES') ?>:</td>
		<td><?=$modulename ?></td>
	</tr>

	<tr>
		<td><?= translate('ACTIVITY_STRATEGY_STRAGEGYNAME') ?></td>
		<td><input type="text" name="row[strategyname]"
			id="strategyname<?=$i ?>" value="<?= $row['strategyname'] ?>"></td>
	</tr>
	<tr>
		<td><?= translate('ACTIVITY_TREASUREBOX_LOWONERATIO') ?></td>
		<td><input type="text" name="row[lowone]" id="lowone" value='<?=$row['lowone'] ?>' /></td>

	</tr>
	<tr>
		<td><?= translate('ACTIVITY_TREASUREBOX_LOWTENRATIO') ?></td>
		<td><input type="text" name="row[lowten]" id="lowten" value='<?=$row['lowten'] ?>' /></td>

	</tr>
	<tr>
		<td><?= translate('ACTIVITY_TREASUREBOX_HIGHONERATIO') ?></td>
		<td><input type="text" name="row[highone]" id="highone"	value="<?= $row['highone'] ?>"></td>

	</tr>
	<tr>
		<td><?= translate('ACTIVITY_TREASUREBOX_HIGHTENRATIO') ?></td>
		<td><input type="text" name="row[highten]" id="highten"	value="<?= $row['highten'] ?>"></td>

	</tr>

	<tr>
		<td><?= translate('ACTIVITY_TREASUREBOX_LOWCOLDTIME') ?></td>
		<td><select name="row[lowcoldtime]" id="lowcoldtime">
		<?php  for($count = 1; $count <= 100; ++$count) { ?>
			<option value="<?=$count ?>"
			<?php if($count == $row['lowcoldtime']) echo "selected"; ?>><?=$count ?></option>
			<?php } ?>
		</select></td>

	</tr>
	<tr>
		<td><?= translate('ACTIVITY_TREASUREBOX_HIGHCOLDTIME') ?></td>
		<td><select name="row[highcoldtime]" id="highcoldtime">
		<?php  for($count = 1; $count <= 100; ++$count) { ?>
			<option value="<?=$count ?>"
			<?php if($count == $row['highcoldtime']) echo "selected"; ?>><?=$count ?></option>
			<?php } ?>
		</select></td>
	</tr>
	<input name="tablename" type='hidden' value="<?=$tablename ?>" />
	<input name="strategyid" type='hidden' value="<?=$row['strategyid'] ?>" />
	<input name="tableenum" type='hidden' value="<?=$tableenum ?>" />
	<tr>
		<td>
		<div align="center"><input type="hidden" name="tablename"
			value="<?= $tablename ?>"> <input name="submit" type="submit"
			id="submit" value="<?= translate('SUBMIT') ?>" /></div>
		</td>
		<td>
		<div align="center"><input type="reset"
			value="<?= translate('RESET') ?>" id="reset" /></div>
		</td>
	</tr>
</table>
</form>

<script type="text/javascript">
            SG.init("core.form", function() {
                $.formValidator.initConfig({formid: "#rowForm", submitonce: true});
                for(var count =0; count < <?=count($xishu) ?>; ++count)
                {
                	$("#strategyname").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});                 	
                	$("#strategyid").formValidator({empty: false, onshow: '<?= translate('C_ONLY_NUM') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerror: '<?= translate('C_ONLY_NUM') ?>'});
                	
                	//以下是0到1的范围  ^(0\.\d*[1-9])|(1)$ 或者  ^(0\.\d|(1)$
                	// regexValidator({regexp: "^(0\.\d)|(1)$", onerror: '<?= translate('C_NUM_BETTWEEN_0_AND_1') ?>'});                	
                	// >=0 (^0$)|(^[1-9]\d*$)
                	// regexValidator({regexp: '(^0$)|(^[1-9]\d*$)',  onerror: '<?= translate('C_NUM_BIGTHEN_1') ?>'});
                	//正整数
                	// regexValidator({regexp:'intege1',datatype:'enum',onerror:'<?= translate('C_NUM_BIGTHEN_1') ?>'});
                	//regexValidator({regexp:'^[1-9]\d*|0$',onerror:'<?= translate('C_NUM_BIGTHEN_0') ?>'});
                	$("#lowten").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: '^(0\.\d*[1-9])|(1)$',  onerror: '<?= translate('C_NUM_BETTWEEN_0_AND_1') ?>'});
                	$("#highten").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp:'^(0\.\d*[1-9])|(1)$', onerror: '<?= translate('C_NUM_BETTWEEN_0_AND_1') ?>'});
                	
                	$("#lowone").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: '^(0\.\d*[1-9])|(1)$',  onerror: '<?= translate('C_NUM_BETTWEEN_0_AND_1') ?>'});
                	$("#highone").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp:'^(0\.\d*[1-9])|(1)$', onerror: '<?= translate('C_NUM_BETTWEEN_0_AND_1') ?>'});
                	//$("#lowcoldtime"+count).formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({ regExp: '^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$', onerror: '<?= translate('C_PLZ_INPUT_FLOAT') ?>'});
                	//$("#highcoldtime"+count).formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({ regExp: "^(([1-9])|([1-9][0-9]*))$", onerror: '<?= translate('C_PLZ_INPUT_FLOAT') ?>'});
              
                }
               });
    </script>
</body>
</html>
